using Godot;

public partial class WeaponHeal : WeaponEntity
{
    public static VFXManager VFXManager => GameManager.Instance.LevelManager.VFXManager;
    public WeaponHeal(SkillModel md, Robot robot) : base(md)
    {
        OwnerRobot = robot;
    }

    public override void Cast(SkillEventEntity e = null)
    {
        int baseHp = e.Skill.SkillData["AddHp"].As<int>();
        int percent = e.Skill.SkillData["AddPercentHp"].As<int>();
        int amount = baseHp + Mathf.RoundToInt(e.Target.Entity.TotalHealth * percent / 100f);
        e.Target.TakeHeal(amount);
        VFXManager.VFXWeaponRepair(e.Target.Position, amount);
    }
}